package vip.web3.admin.common.export;

import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import vip.web3.common.enums.RecordStatusEnum;

public class RecordStatusConverter implements ExConverter<Integer> {

    @Override
    public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        RecordStatusEnum statusEnum = RecordStatusEnum.get(value);
        if (statusEnum == null) {
            return new CellData<>("未知");
        }

        return new CellData<>(statusEnum.getDesc());
    }
}
